package com.aaa.service.scl.impl;

import com.aaa.service.scl.SclRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.aaa.entity.MyPage;
import com.aaa.entity.scl.SclRecord;
import com.aaa.entity.TjMessage;
import com.aaa.entity.Ttongji;
import com.aaa.service.scl.SclRecordService;
import com.aaa.dao.scl.SclRecordDao;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * (SclRecord)表服务实现类
 *
 * @author makejava
 * @since 2022-10-27 19:11:05
 */
@Service
public class SclRecordServiceImpl implements SclRecordService {
   @Autowired
   private SclRecordDao sclRecordDao;

   @Override
   public SclRecord checkrecord(SclRecord record) {
      SclRecord sclRecord = sclRecordDao.selectOne(record);
      return sclRecord;
   }

   @Override
   public int insertRecord(SclRecord record) {
      record.setCreatetime(new Date());
      int i = sclRecordDao.insert(record);
      System.out.println(record.getId());
      return record.getId();
   }

   @Override
   public List<Ttongji> getTjData() {
      return sclRecordDao.getTjData();
   }

   @Override
   public PageInfo getTjData2(MyPage myPage,TjMessage tjMessage) {
      PageHelper.startPage(myPage.getPage(),myPage.getLimit());
      return new PageInfo(sclRecordDao.getTjData2(tjMessage));
   }
}

